/*
 * @Author: lusx 
 * @Date: 2020-04-29 11:06:07 
 * @Last Modified by: lusx
 * @Last Modified time: 2020-05-21 16:00:31
 */
import React, { useState } from 'react';
import { Switch, Route } from 'react-router-dom';
import { Tabs } from 'weaver-mobile';
import List from './list';

// const pathnames = {
//     '0': '',
//     '1': '/wait',
//     '2': '/already'
// };
export default class ViewFeedback extends React.Component {
    render(){
        const [actionTab, setActionTab] = useState(0);
        const { match: { path, url }, history: { push }, location: { pathname } } = this.props;
        // const tabs2 = [
        //     { title: '全部' },
        //     { title: '待阅反馈' },
        //     { title: '已阅反馈' },
        // ];
        return (
            <div>
                {/* <Tabs tabs={tabs2}
                    initialPage={0}
                    onChange={(tab, index) => { setActionTab(index); push(`${url}${pathnames[index.toString()]}`) }}
                /> */}
                <Switch>
                    <Route path={pathname}>
                        <List actionTab={actionTab.toString()} />
                    </Route>
                </Switch>
            </div>
        )
    }
}